3.7 \(\int (a+a \cos (c+d x)) \sec (c+d x) \, dx\)

Optimal. Leaf size=16 \[ \frac {a \tanh ^{-1}(\sin (c+d x))}{d}+a x \]

[Out]

a*x+a*arctanh(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2735, 3770} \[ \frac {a \tanh ^{-1}(\sin (c+d x))}{d}+a x \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Cos[c + d*x])*Sec[c + d*x],x]

[Out]

a*x + (a*ArcTanh[Sin[c + d*x]])/d

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int (a+a \cos (c+d x)) \sec (c+d x) \, dx &=a x+a \int \sec (c+d x) \, dx\\ &=a x+\frac {a \tanh ^{-1}(\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 16, normalized size = 1.00 \[ \frac {a \tanh ^{-1}(\sin (c+d x))}{d}+a x \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Cos[c + d*x])*Sec[c + d*x],x]

[Out]

a*x + (a*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

fricas [B]  time = 1.68, size = 36, normalized size = 2.25 \[ \frac {2 \, a d x + a \log \left (\sin \left (d x + c\right ) + 1\right ) - a \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="fricas")

[Out]

1/2*(2*a*d*x + a*log(sin(d*x + c) + 1) - a*log(-sin(d*x + c) + 1))/d

________________________________________________________________________________________

giac [B]  time = 0.48, size = 43, normalized size = 2.69 \[ \frac {{\left (d x + c\right )} a + a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="giac")

[Out]

((d*x + c)*a + a*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - a*log(abs(tan(1/2*d*x + 1/2*c) - 1)))/d

________________________________________________________________________________________

maple [A]  time = 0.07, size = 30, normalized size = 1.88 \[ a x +\frac {a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {c a}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*cos(d*x+c))*sec(d*x+c),x)

[Out]

a*x+1/d*a*ln(sec(d*x+c)+tan(d*x+c))+1/d*c*a

________________________________________________________________________________________

maxima [A]  time = 0.30, size = 28, normalized size = 1.75 \[ \frac {{\left (d x + c\right )} a + a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="maxima")

[Out]

((d*x + c)*a + a*log(sec(d*x + c) + tan(d*x + c)))/d

________________________________________________________________________________________

mupad [B]  time = 0.34, size = 20, normalized size = 1.25 \[ a\,x+\frac {2\,a\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*cos(c + d*x))/cos(c + d*x),x)

[Out]

a*x + (2*a*atanh(tan(c/2 + (d*x)/2)))/d

________________________________________________________________________________________

sympy [A]  time = 4.92, size = 49, normalized size = 3.06 \[ a x + a \left (\begin {cases} \frac {x \tan {\relax (c )} \sec {\relax (c )}}{\tan {\relax (c )} + \sec {\relax (c )}} + \frac {x \sec ^{2}{\relax (c )}}{\tan {\relax (c )} + \sec {\relax (c )}} & \text {for}\: d = 0 \\\frac {\log {\left (\tan {\left (c + d x \right )} + \sec {\left (c + d x \right )} \right )}}{d} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x)

[Out]

a*x + a*Piecewise((x*tan(c)*sec(c)/(tan(c) + sec(c)) + x*sec(c)**2/(tan(c) + sec(c)), Eq(d, 0)), (log(tan(c +
d*x) + sec(c + d*x))/d, True))

________________________________________________________________________________________